package com.ccsoft.zknote.controller;

import com.ccsoft.zknote.pojo.system.JsonResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

/**
 * @author chanchaw
 * @create 2025-07-01 18:32
 */
@CrossOrigin
@RestController
@RequestMapping("/flutter")
public class FlutterController {

    @PostMapping("/homeData")
    public JsonResult getHomeData(){
        //#region bannerList
        Map<String,String> map01 = new HashMap();
        map01.put("icon","https://xdfznh.club/kbp/material/banners/flutter_banner01.png");
        map01.put("title","第一个banner");
        map01.put("url","www.baidu.com");

        Map<String,String> map02 = new HashMap();
        map02.put("icon","https://xdfznh.club/kbp/material/banners/flutter_banner02.png");
        map02.put("title","第二个banner");
        map02.put("url","www.qq.com");

        Map<String,String> map03 = new HashMap();
        map03.put("icon","https://o.devio.org/images/fa/photo-1601513041797-a79a526a521e.webp");
        map03.put("title","第三个banner");
        map03.put("url","www.sina.com.cn");

        Map<String,String> map04 = new HashMap();
        map04.put("icon","https://o.devio.org/images/other/as-cover.png");
        map04.put("title","第四个banner");
        map04.put("url","https://www.moxingshu.cn/article/685cfbf0f163687cdfaafd59");

        Map<String,String> map05 = new HashMap();
        map05.put("icon","https://xdfznh.club/kbp/material/banners/flutter_banner03.png");
        map05.put("title","第五个banner");
        map05.put("url","https://www.geekailab.com/io/tools/json-to-dart/");

        List<Map<String,String>> list = new ArrayList<>();
        list.add(map01);list.add(map02);list.add(map03);list.add(map04);list.add(map05);
        //#endregion
        //#region localNavList
        Map<String,String> map11 = new HashMap();
        map11.put("icon","https://xdfznh.club/kbp/flutter/avatar/my.png");
        map11.put("title","我的");
        map11.put("url","https://www.baidu.com/");

        Map<String,String> map12 = new HashMap();
        map12.put("icon","https://xdfznh.club/kbp/flutter/avatar/local.png");
        map12.put("title","本地");
        map12.put("url","https://www.bing.com/?toWww=1&redig=C8F51384C4F8491B9CD3FEBB263D2624");

        Map<String,String> map13 = new HashMap();
        map13.put("icon","https://xdfznh.club/kbp/flutter/avatar/favorite.png");
        map13.put("title","收藏的");
        map13.put("url","https://www.sina.com.cn/");

        Map<String,String> map14 = new HashMap();
        map14.put("icon","https://xdfznh.club/kbp/flutter/avatar/travel.png");
        map14.put("title","旅游");
        map14.put("url","https://www.qq.com/");

        Map<String,String> map15 = new HashMap();
        map15.put("icon","https://xdfznh.club/kbp/flutter/avatar/home.png");
        map15.put("title","home");
        map15.put("url","https://www.163.com/");

        List<Map<String,String>> localNavList = new ArrayList<>();
        localNavList.add(map11);localNavList.add(map12);localNavList.add(map13);localNavList.add(map14);localNavList.add(map15);
        //#endregion
        //#region config
        Map<String,String> config = new HashMap<>();
        config.put("searchUrl","https://xdfznh.club/kb/develop/language/java/01.%E5%9F%BA%E7%A1%80/01.%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B.html");
        //#endregion
        //#region gridNav
        //#region GridNav.hotel
        Map<String,String> hotelMainItem = new HashMap<>();
        hotelMainItem.put("icon","https://xdfznh.club/kbp/flutter/proj/卡通酒店.png");
        hotelMainItem.put("title","卡通酒店");
        hotelMainItem.put("url","www.sina.com");
        hotelMainItem.put("statusBarColor","red");

        Map<String,String> hotel01 = new HashMap<>();
        hotel01.put("icon","https://xdfznh.club/kbp/flutter/proj/酒店01.png");
        hotel01.put("title","海外酒店");
        hotel01.put("url","www.sina.com");
        hotel01.put("statusBarColor","red");

        Map<String,String> hotel02 = new HashMap<>();
        hotel02.put("icon","https://xdfznh.club/kbp/flutter/proj/酒店02.png");
        hotel02.put("title","特价酒店");
        hotel02.put("url","www.sina.com");
        hotel02.put("statusBarColor","red");

        Map<String,String> hotel03 = new HashMap<>();
        hotel03.put("icon","https://xdfznh.club/kbp/flutter/proj/酒店03.png");
        hotel03.put("title","爆款");
        hotel03.put("url","www.sina.com");
        hotel03.put("statusBarColor","red");

        Map<String,String> hotel04 = new HashMap<>();
        hotel04.put("icon","https://xdfznh.club/kbp/flutter/proj/酒店04.png");
        hotel04.put("title","民宿");
        hotel04.put("url","www.sina.com");
        hotel04.put("statusBarColor","red");

        Map<String,Object> hotel = new HashMap<>();
        hotel.put("startColor","");
        hotel.put("endColor","");
        hotel.put("mainItem",hotelMainItem);
        hotel.put("item1",hotel01);
        hotel.put("item2",hotel02);
        hotel.put("item3",hotel03);
        hotel.put("item4",hotel04);
        //#endregion
        //#region GridNav.airplane
        Map<String,String> planeMainItem = new HashMap<>();
        planeMainItem.put("icon","https://xdfznh.club/kbp/flutter/proj/卡通飞机.png");
        planeMainItem.put("title","卡通飞机");
        planeMainItem.put("url","www.baidu.com");
        planeMainItem.put("statusBarColor","red");

        Map<String,String> plane01 = new HashMap<>();
        plane01.put("icon","https://xdfznh.club/kbp/flutter/proj/飞机01.png");
        plane01.put("title","火车票");
        plane01.put("url","www.baidu.com");
        plane01.put("statusBarColor","red");

        Map<String,String> plane02 = new HashMap<>();
        plane02.put("icon","https://xdfznh.club/kbp/flutter/proj/飞机02.png");
        plane02.put("title","特价机票");
        plane02.put("url","www.baidu.com");
        plane02.put("statusBarColor","red");

        Map<String,String> plane03 = new HashMap<>();
        plane03.put("icon","https://xdfznh.club/kbp/flutter/proj/飞机03.png");
        plane03.put("title","汽车票*船票");
        plane03.put("url","www.baidu.com");
        plane03.put("statusBarColor","red");

        Map<String,String> plane04 = new HashMap<>();
        plane04.put("icon","https://xdfznh.club/kbp/flutter/proj/飞机04.png");
        plane04.put("title","专车*租车");
        plane04.put("url","www.baidu.com");
        plane04.put("statusBarColor","red");

        Map<String,Object> plane = new HashMap<>();
        plane.put("startColor","");
        plane.put("endColor","");
        plane.put("mainItem",planeMainItem);
        plane.put("item1",plane01);
        plane.put("item2",plane02);
        plane.put("item3",plane03);
        plane.put("item4",plane04);
        //#endregion
        //#region GridNav.travel
        Map<String,String> travelMainItem = new HashMap<>();
        travelMainItem.put("icon","https://xdfznh.club/kbp/flutter/proj/旅游景点.png");
        travelMainItem.put("title","旅游景点");
        travelMainItem.put("url","www.qq.com");
        travelMainItem.put("statusBarColor","red");

        Map<String,String> travel01 = new HashMap<>();
        travel01.put("icon","https://xdfznh.club/kbp/flutter/proj/旅游01.png");
        travel01.put("title","门票");
        travel01.put("url","www.qq.com");
        travel01.put("statusBarColor","red");

        Map<String,String> travel02 = new HashMap<>();
        travel02.put("icon","https://xdfznh.club/kbp/flutter/proj/旅游02.png");
        travel02.put("title","目的地攻略");
        travel02.put("url","www.qq.com");
        travel02.put("statusBarColor","red");

        Map<String,String> travel03 = new HashMap<>();
        travel03.put("icon","https://xdfznh.club/kbp/flutter/proj/旅游03.png");
        travel03.put("title","私家团");
        travel03.put("url","www.qq.com");
        travel03.put("statusBarColor","red");

        Map<String,String> travel04 = new HashMap<>();
        travel04.put("icon","https://xdfznh.club/kbp/flutter/proj/旅游04.png");
        travel04.put("title","定制旅行");
        travel04.put("url","www.qq.com");
        travel04.put("statusBarColor","red");

        Map<String,Object> travel = new HashMap<>();
        travel.put("startColor","");
        travel.put("endColor","");
        travel.put("mainItem",travelMainItem);
        travel.put("item1",travel01);
        travel.put("item2",travel02);
        travel.put("item3",travel03);
        travel.put("item4",travel04);
        //#endregion

        Map<String,Object> gridNav = new HashMap<>();
        gridNav.put("hotel",hotel);
        gridNav.put("flight",plane);
        gridNav.put("travel",travel);
        //#endregion
        //#region subNavList
        Map<String,String> subNav01 = new HashMap<>();
        subNav01.put("icon","https://xdfznh.club/kbp/flutter/proj/wifi.png");
        subNav01.put("title","WIFI");
        subNav01.put("url","www.baidu.com");

        Map<String,String> subNav02 = new HashMap<>();
        subNav02.put("icon","https://xdfznh.club/kbp/flutter/proj/安全.png");
        subNav02.put("title","安全");
        subNav02.put("url","www.baidu.com");

        Map<String,String> subNav03 = new HashMap<>();
        subNav03.put("icon","https://xdfznh.club/kbp/flutter/proj/兑换外币.png");
        subNav03.put("title","兑换外币");
        subNav03.put("url","www.baidu.com");

        Map<String,String> subNav04 = new HashMap<>();
        subNav04.put("icon","https://xdfznh.club/kbp/flutter/proj/购物.png");
        subNav04.put("title","购物");
        subNav04.put("url","www.baidu.com");

        Map<String,String> subNav05 = new HashMap<>();
        subNav05.put("icon","https://xdfznh.club/kbp/flutter/proj/路线方向导航.png");
        subNav05.put("title","向导");
        subNav05.put("url","www.baidu.com");

        Map<String,String> subNav06 = new HashMap<>();
        subNav06.put("icon","https://xdfznh.club/kbp/flutter/proj/游玩.png");
        subNav06.put("title","游玩");
        subNav06.put("url","www.baidu.com");

        Map<String,String> subNav07 = new HashMap<>();
        subNav07.put("icon","https://xdfznh.club/kbp/flutter/proj/港澳自由行.png");
        subNav07.put("title","港澳自由行");
        subNav07.put("url","www.baidu.com");

        Map<String,String> subNav08 = new HashMap<>();
        subNav08.put("icon","https://xdfznh.club/kbp/flutter/proj/礼品.png");
        subNav08.put("title","礼品");
        subNav08.put("url","www.baidu.com");

        Map<String,String> subNav09 = new HashMap<>();
        subNav09.put("icon","https://xdfznh.club/kbp/flutter/proj/信用卡.png");
        subNav09.put("title","信用卡");
        subNav09.put("url","www.baidu.com");

        Map<String,String> subNav10 = new HashMap<>();
        subNav10.put("icon","https://xdfznh.club/kbp/flutter/proj/AI.png");
        subNav10.put("title","AI");
        subNav10.put("url","www.baidu.com");

        Map<String,String> subNav11 = new HashMap<>();
        subNav11.put("icon","https://xdfznh.club/kbp/flutter/proj/小轿车.png");
        subNav11.put("title","小轿车");
        subNav11.put("url","www.baidu.com");

        Map<String,String> subNav12 = new HashMap<>();
        subNav12.put("icon","https://xdfznh.club/kbp/flutter/proj/更多.png");
        subNav12.put("title","小轿车");
        subNav12.put("url","www.baidu.com");

        List<Map<String,String>> subNavList = new ArrayList<>();
        subNavList.add(subNav01);subNavList.add(subNav02);subNavList.add(subNav03);subNavList.add(subNav04);subNavList.add(subNav05);
        subNavList.add(subNav06);subNavList.add(subNav07);subNavList.add(subNav08);subNavList.add(subNav09);subNavList.add(subNav10);
        //#endregion
        //#region salesBox
        Map<String,String> bigCard1 = new HashMap<>();
        bigCard1.put("icon","https://xdfznh.club/kbp/flutter/proj/卡通酒店.png");
        bigCard1.put("title","超级会员");
        bigCard1.put("url","www.baidu.com");
        bigCard1.put("statusBarColor","");

        Map<String,String> bigCard2 = new HashMap<>();
        bigCard2.put("icon","https://xdfznh.club/kbp/flutter/proj/卡通飞机.png");
        bigCard2.put("title","爆款酒店");
        bigCard2.put("url","www.baidu.com");
        bigCard2.put("statusBarColor","");

        Map<String,String> smallCard1 = new HashMap<>();
        smallCard1.put("icon","https://xdfznh.club/kbp/flutter/proj/旅游景点.png");
        smallCard1.put("title","限时秒杀");
        smallCard1.put("url","www.baidu.com");
        smallCard1.put("statusBarColor","");

        Map<String,String> smallCard2 = new HashMap<>();
        smallCard2.put("icon","https://xdfznh.club/kbp/flutter/proj/酒店01.png");
        smallCard2.put("title","服务中心");
        smallCard2.put("url","www.baidu.com");
        smallCard2.put("statusBarColor","");

        Map<String,String> smallCard3 = new HashMap<>();
        smallCard3.put("icon","https://xdfznh.club/kbp/flutter/proj/飞机01.png");
        smallCard3.put("title","会员福利");
        smallCard3.put("url","www.baidu.com");
        smallCard3.put("statusBarColor","");

        Map<String,String> smallCard4 = new HashMap<>();
        smallCard4.put("icon","https://xdfznh.club/kbp/flutter/proj/旅游03.png");
        smallCard4.put("title","优品商城");
        smallCard4.put("url","www.baidu.com");
        smallCard4.put("statusBarColor","");

        Map<String,Object> salesBox = new HashMap<>();
        salesBox.put("icon","https://xdfznh.club/kbp/flutter/proj/飞机03.png");
        salesBox.put("moreUrl","www.qq.com");
        salesBox.put("bigCard1", bigCard1);
        salesBox.put("bigCard2", bigCard2);
        salesBox.put("smallCard1", smallCard1);
        salesBox.put("smallCard2", smallCard2);
        salesBox.put("smallCard3", smallCard3);
        salesBox.put("smallCard4", smallCard4);
        //#endregion

        //#region 最外层 Map
        Map<String, Object> ret = new HashMap<>();
        ret.put("config", config);
        ret.put("bannerList", list);
        ret.put("localNavList", localNavList);
        ret.put("gridNav", gridNav);
        ret.put("subNavList", subNavList);
        ret.put("salesBox", salesBox);
        //#endregion
        return JsonResult.ok(ret);
    }

    @PostMapping("searchData")
    public JsonResult getSearchData(){
        Map<String,String> map01 = new HashMap<>();
        map01.put("code","hotel001");
        map01.put("word","北京丽君酒店");
        map01.put("type","hotel");
        map01.put("price","三星价格");
        map01.put("zonename","天安门王府井");
        map01.put("start","五星级");
        map01.put("districtname","北京");
        map01.put("url","www.qq.com");

        Map<String,String> map02 = new HashMap<>();
        map02.put("code","hotel002");
        map02.put("word","上海千禧酒店");
        map02.put("type","hotel");
        map02.put("price","预定价格");
        map02.put("zonename","国贸");
        map02.put("start","五星级");
        map02.put("districtname","上海");
        map02.put("url","www.baidu.com");

        Map<String,String> map03 = new HashMap<>();
        map03.put("code","hotel003");
        map03.put("word","希尔顿欢朋酒店");
        map03.put("type","hotel");
        map03.put("price","实时计价");
        map03.put("zonename","常熟");
        map03.put("start","五星级");
        map03.put("districtname","苏州");
        map03.put("url","www.sina.cn");

        Map<String,String> map04 = new HashMap<>();
        map04.put("code","hotel004");
        map04.put("word","常熟龙腾希尔顿");
        map04.put("type","hotel");
        map04.put("price","季节浮动");
        map04.put("zonename","琴川");
        map04.put("start","七星级");
        map04.put("districtname","常熟");
        map04.put("url","www.sina.cn");

        Map<String,String> map05 = new HashMap<>();
        map05.put("code","hotel005");
        map05.put("word","宜家常熟");
        map05.put("type","hotel");
        map05.put("price","平价");
        map05.put("zonename","常福街道");
        map05.put("start","二星级");
        map05.put("districtname","常熟");
        map05.put("url","www.sina.cn");

        Map<String,String> map06 = new HashMap<>();
        map06.put("code","hotel006");
        map06.put("word","锦江之星");
        map06.put("type","hotel");
        map06.put("price","中庸的价格");
        map06.put("zonename","虞山街道");
        map06.put("start","二星级");
        map06.put("districtname","常熟市区");
        map06.put("url","www.sina.cn");

        Map<String,String> map07 = new HashMap<>();
        map07.put("code","hotel007");
        map07.put("word","格林豪泰");
        map07.put("type","hotel");
        map07.put("price","很格林的价格");
        map07.put("zonename","尚湖街道");
        map07.put("start","二星级");
        map07.put("districtname","常熟镇区");
        map07.put("url","www.sina.cn");

        List<Map<String,String>> retList = new ArrayList<>();
        retList.add(map01);
        retList.add(map02);
        retList.add(map03);
        retList.add(map04);
        retList.add(map05);
        retList.add(map06);
        retList.add(map07);
        return JsonResult.ok(retList);
    }
}
